package com.office.meeting.controller;

import com.office.common.core.controller.BaseController;
import com.office.common.core.domain.AjaxResult;
import com.office.common.core.page.TableDataInfo;
import com.office.meeting.domain.MeetingReport;
import com.office.meeting.service.MeetingUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import java.util.List;

import static com.office.common.utils.PageUtils.startPage;

/**
 * @author: 柒月
 * @date: 2025/6/27 下午4:09
 * @version: 1.0
 */
@RestController
@RequestMapping("/meeting/user")
public class MeetingUserController extends BaseController {

    @Resource
    private MeetingUserService meetingUserService;

    /**
     *
     * @return 获取本月会议数
     */
    @GetMapping("/month/count")
    public AjaxResult monthCount() {
        return AjaxResult.success(meetingUserService.getMeetingMonthlyCount());
    }

    /**
     *
     * @return 本月参加的人数
     */
    @GetMapping("/pepople/count")
    public AjaxResult countPeople() {
        return AjaxResult.success(meetingUserService.getMeetingPepopleCount());
    }

    /**
     *
     * @return 分页后的最近的会议信息
     */
    @GetMapping("/all/meeting/info")
    public TableDataInfo allMeetingInfo() {
        startPage();
        List<MeetingReport> list = meetingUserService.getAllMeetingInfo();
        return getDataTable(list);
    }

    /**
     *
     * @return 我参与的会议的信息
     */
    @GetMapping("/participate/info")
    public TableDataInfo participateMeeting() {
        startPage();
        List<MeetingReport> list = meetingUserService.getParticipateMeeting();
        return getDataTable(list);
    }
}
